package com.principal;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnKeyListener;
import android.view.Window;
import android.widget.Button;

public class AppcuadradoActivity extends Activity {
    
	Button btnRestore, btnSave, btnAbout;
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.principal);
        
        btnRestore = (Button) findViewById(R.id.btnRestore);
		btnSave = (Button) findViewById(R.id.btnSave);
		btnAbout = (Button) findViewById(R.id.btnAbout);
		
		
		//Creación de Listeners
		
    }
    
    // Lanzamiento del menú
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.principal_menu, menu);
        return true;
    }
    
    //Controla la pulsación de los botones del menú
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
       switch (item.getItemId()) {
            case R.id.btSettings:
              //Abrir vista Settings
               return true;
            case R.id.btExit:
               //Cerrar app
            	this.finish();
               return true;
            default:
               return super.onOptionsItemSelected(item);
        }
    }
}